<?php
/**
 *
 * @User yangyang
 * @Date 2023/5/16 18:05
 */

namespace App\Modules\Libs;

class Vars {
    public static $vars = [
        'FilePath'              => null,
        'FileUploadRoot'        => null,
        'Today'                 => null,
        'ImagePath'             => null,
        'ImageUploadPath'       => null,
        'ImageUploadPathFull'   => null,
        'FileUploadPath'        => null,
        'EditorImageUploadPath' => null,
    ];

    public static function init() {
        if(Vars::$vars['Today'] === today()->toDateString()){
            return ;
        }

        Vars::$vars['FilePath'] = config('filesystems.disks.qiniu.url');
        Vars::$vars['FileUploadRoot'] = config('filesystems.disks.admin.root');
        Vars::$vars['Today'] = today()->toDateString();
        Vars::$vars['ImagePath'] = config('admin.upload.directory.image');
        Vars::$vars['ImageUploadPath'] = config('admin.upload.directory.image') . '/' . Vars::$vars['Today'];
        Vars::$vars['ImageUploadPathFull'] = Vars::$vars['FileUploadRoot'] . '/' . Vars::$vars['ImageUploadPath'];
        Vars::$vars['FileUploadPath'] = config('admin.upload.directory.file') . '/' . Vars::$vars['Today'];
    }
}
